package com.gm.wholesale.module.config.model;

import com.gm.commonlib.base.baseBean.DataResp;
import com.gm.commonlib.base.baseui.baseFragment.BaseFragment;
import com.gm.commonlib.network.BaseHttpObserver;
import com.gm.commonlib.network.HttpClient;
import com.gm.commonlib.network.HttpServicesHolder;
import com.gm.wholesale.module.config.api.IConfigApi;
import com.gm.wholesale.module.config.bean.ConfigBean;

import io.reactivex.Observable;

public class ConfigModel {
    public static void getConfig(BaseFragment activity, BaseHttpObserver<DataResp<ConfigBean>> observer) {
        HttpClient.sendRequest(activity, new HttpServicesHolder<IConfigApi, DataResp<ConfigBean>>() {
            @Override
            public Observable<DataResp<ConfigBean>> getHttpObservable(IConfigApi instance) {
                return instance.getConfig();
            }
        }, observer);
    }
}
